{include file="../blog/admin/view/public/header.tpl"}

<div class="col-sm-offset-3 col-sm-6">
<form class="form-signin" method="post" kyo-ajax role="form">
<h2 class="form-signin-heading">找回密码</h2>
<input type="text" id='username' name="username" class="form-control margin-bottom-10" placeholder="用户名" required autofocus>
<input type="text" id='findtool' name="findtool" class="form-control margin-bottom-10" placeholder="邮箱/手机" required>
<input type="text" id="code" name="code" class="form-control margin-bottom-10 hidden" placeholder="邮箱/手机验证码">
<input type="text" id="captchaInput" name="captcha" class="form-control margin-bottom-10" placeholder="验证码">
<span class="captcha margin-bottom-10 col-sm-8">{:captcha_img()}</span>
<span class="col-sm-4">
<a href="{:url('home/index/index')}">返回首页</a>
<br />
<br />
<a href="{:url('Pub/login')}">返回登录</a>
</span>
<button class="btn btn-lg btn-primary btn-block" type="submit">获取手机或邮箱验证码</button>
</form>
<div>

{include file="../blog/admin/view/public/footer.tpl"}

<script>
    var btn_submit = $('.btn-lg');
    var username = $('#username');
    var findtool = $('#findtool');
    var code = $('#code');

    //刷新验证码
    function ref_captcha() {
        $('#captchaInput').val('');
        $('#captchaInput').focus();
        var img = $('.captcha').children('img');
        img.attr('src', img.attr('src') + "?"+Math.random());
    }
    //点击刷新验证码
    $('.captcha').children('img').click(ref_captcha);


    function forget_close() {
        history.go(-1);
    }

    //btn_submit.click(forget_close);

    function step_code() {
        username.attr("readonly", "readonly");
        findtool.attr("readonly", "readonly");
        kyoAddClass(username, 'disabled');
        kyoAddClass(findtool, 'disabled');
        kyoDelClass(code, 'hidden');
        code.focus();
        btn_submit.html('确定提交');
    }

</script>
